package top.wettis.chat.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import top.wettis.chat.pojo.DO.User;
import top.wettis.chat.pojo.Query.UserInfo;
import top.wettis.chat.pojo.VO.Result;

import java.util.List;

/**
 * <p>
 * 用户表 Mapper 接口
 * </p>
 *
 * @author wettis
 * @since 2023-03-25
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    List<User> selectAllInfo();

    User selectByOneId(@Param("id") Integer id);

    int deleteAll(@Param("id") Integer id);

    void insertUserInfo(
            @Param("password") String password,
            @Param("username")  String username
            ,@Param("neckName")  String neckName
            ,@Param("phone")  String phone
            ,@Param("role")  String role);

    void updateUserInfo(
            @Param("password") String password,
            @Param("id") Integer userId
            ,@Param("username")  String username
            ,@Param("neckName")  String neckName
            ,@Param("phone")  String phone
            ,@Param("role")  String role);

    void updatepassword(@Param("id")Integer id,@Param("bcrypt") String bcrypt);
}
